<?php switch($content_type){
case 'mq_ta': ?>
<dl>
    <dd class="cp-header">
        <?php echo $text_topics_awaiting_approval_intro; ?>
        <select id="fid" name="fid">
            <?php if($has_global_privilege){ ?>
            <option value=""><?php echo $text_all_forum; ?></option>
            <?php } ?>
            <?php foreach($forums as $forum){ ?>
            <option value="<?php echo $forum['forum_id']; ?>" <?php echo $forum_option_id==$forum['forum_id']?'selected="selected"':'' ?>><?php echo $forum['forum_name']; ?></option>
            <?php foreach($sub_forums[$forum['forum_id']] as $sub_forum){ ?>
                <option value="<?php echo $sub_forum['forum_id']; ?>" <?php echo $forum_option_id==$sub_forum['forum_id']?'selected="selected"':'' ?>>&nbsp;&nbsp;<?php echo $sub_forum['forum_name']; ?></option>
                <?php } ?>
            <?php } ?>
        </select>
    </dd>
    <dd class="cp-content">
    <?php if(!$approval_topics){ ?>
        <dl>
            <dd><?php echo $text_no_topics_approval; ?></dd>
        </dl>
    <?php }else{ ?>
        <form id="topic-approval-form" name="topic-approval-form" action="" method="post">
        <dl class="cp-list-heading">
            <dd class="cp-list-heading-first cp-list-first-unindent2"><?php echo $text_heading_view_details; ?></dd>
            <dd class="cp-list-heading-second cp-list-second-expand2"><?php echo $text_heading_location; ?></dd>
            <dd class="cp-list-heading-third"><?php echo $text_heading_mark; ?></dd>
        </dl>
        <?php foreach($approval_topics as $approval_topic){ ?>
        <dl class="cp-list">
            <dd class="cp-list-first cp-list-first-unindent">
                <a href="<?php echo $approval_topic['topic_moderating_link']; ?>"><strong><?php echo $approval_topic['topic_title']; ?></strong></a><br />
                <?php echo $approval_topic['posted_by']; ?>
            </dd>
            <dd class="cp-list-second cp-list-second-expand">
                <?php echo $text_forum; ?>&nbsp;&nbsp;<a href="<?php echo $approval_topic['fourm_link']; ?>"><?php echo $approval_topic['forum_name']; ?></a>
            </dd>
            <dd class="cp-list-third">
                <input type="checkbox" name="marked_t_id[]" value="<?php echo $approval_topic['topic_id'] ; ?>" />
            </dd>
        </dl>
        <?php } ?>
        <dl class="cp-list-bottom">
            <dd>
                <?php echo $text_notify_poster; ?>&nbsp;<input type="checkbox" name="notify-poster" checked="checked" />&nbsp;&nbsp;
                <input class="input-buttons" type="submit" name="approve-topics" value="<?php echo $button_approve; ?>" onclick="{if(confirm('<?php echo $text_confirm_approval; ?>')){this.document.topic-approval-form.submit();return true;}return false;}" />
                &nbsp;&nbsp;
                <input class="input-buttons" type="submit" name="disapprove-topics" value="<?php echo $button_disapprove; ?>" onclick="{if(confirm('<?php echo $text_confirm_disapproval; ?>')){this.document.topic-approval-form.submit();return true;}return false;}" />
            </dd>
            <?php if(count($approval_topics)>1){ ?>
            <dd style="float:left;">
                &bull; <a href="#" onclick="marklist('topic-approval-form', 'marked_t', true); return false;"><?php echo $text_mark_all; ?></a>
                &bull; <a href="#" onclick="marklist('topic-approval-form', 'marked_t', false); return false;"><?php echo $text_unmark_all; ?></a>
            </dd>
            <?php } ?>
        </dl>
        <div class="forum-pagination"><?php echo $pagination; ?></div>
        </form>
    <?php } ?>
    </dd>
</dl>
<script type="text/javascript"><!--
$('#fid').bind('change', function() {
    url = 'index.php?route=community/mcp&mode=mq&action=ta';

    var keyword = $('.cp-header select[name=\'fid\']').attr('value');

    if(keyword != ''){
        url += '&fid=' + encodeURIComponent(keyword);
    }

    location = url;
});
--></script>
<?php break; ?>
<?php case 'mq_pa': ?>
<dl>
    <dd class="cp-header">
        <?php echo $text_posts_awaiting_approval_intro; ?>
        <select id="fid" name="fid">
            <?php if($has_global_privilege){ ?>
            <option value=""><?php echo $text_all_forum; ?></option>
            <?php } ?>
            <?php foreach($forums as $forum){ ?>
            <option value="<?php echo $forum['forum_id']; ?>" <?php echo $forum_option_id==$forum['forum_id']?'selected="selected"':'' ?>><?php echo $forum['forum_name']; ?></option>
            <?php foreach($sub_forums[$forum['forum_id']] as $sub_forum){ ?>
                <option value="<?php echo $sub_forum['forum_id']; ?>" <?php echo $forum_option_id==$sub_forum['forum_id']?'selected="selected"':'' ?>>&nbsp;&nbsp;<?php echo $sub_forum['forum_name']; ?></option>
                <?php } ?>
            <?php } ?>
        </select>
    </dd>
    <dd class="cp-content">
        <?php if(!$approval_posts){ ?>
        <dl>
            <dd><?php echo $text_no_posts_approval; ?></dd>
        </dl>
        <?php }else{ ?>
        <form id="post-approval-form" name="post-approval-form" action="" method="post">
        <dl class="cp-list-heading">
            <dd class="cp-list-heading-first cp-list-first-unindent2"><?php echo $text_heading_view_details; ?></dd>
            <dd class="cp-list-heading-second cp-list-second-expand2"><?php echo $text_heading_location; ?></dd>
            <dd class="cp-list-heading-third"><?php echo $text_heading_mark; ?></dd>
        </dl>
        <?php foreach($approval_posts as $approval_post){ ?>
        <dl class="cp-list">
            <dd class="cp-list-first cp-list-first-unindent">
                <a href="<?php echo $approval_post['post_moderating_link']; ?>"><strong><?php echo $approval_post['post_subject']; ?></strong></a><br />
                <?php echo $approval_post['posted_by']; ?>
            </dd>
            <dd class="cp-list-second cp-list-second-expand">
                <?php echo $text_forum; ?>&nbsp;&nbsp;<a href="<?php echo $approval_post['fourm_link']; ?>"><?php echo $approval_post['forum_name']; ?></a><br />
                <?php echo $text_topic; ?>&nbsp;&nbsp;<a href="<?php echo $approval_post['topic_link']; ?>"><?php echo $approval_post['topic_title']; ?></a>
            </dd>
            <dd class="cp-list-third">
                <input type="checkbox" name="marked_p_id[]" value="<?php echo $approval_post['post_topic_id'] ; ?>" />
            </dd>
        </dl>
        <?php } ?>
        <dl class="cp-list-bottom">
            <dd>
                <?php echo $text_notify_poster; ?>&nbsp;<input type="checkbox" name="notify-poster" checked="checked" />&nbsp;&nbsp;
                <input class="input-buttons" type="submit" name="approve-posts" value="<?php echo $button_approve; ?>" onclick="{if(confirm('<?php echo $text_confirm_approval; ?>')){this.document.post-approval-form.submit();return true;}return false;}" />
                &nbsp;&nbsp;
                <input class="input-buttons" type="submit" name="disapprove-posts" value="<?php echo $button_disapprove; ?>" onclick="{if(confirm('<?php echo $text_confirm_disapproval; ?>')){this.document.post-approval-form.submit();return true;}return false;}" />
            </dd>
            <?php if(count($approval_posts)>1){ ?>
            <dd style="float:left;">
                &bull; <a href="#" onclick="marklist('post-approval-form', 'marked_p', true); return false;"><?php echo $text_mark_all; ?></a>
                &bull; <a href="#" onclick="marklist('post-approval-form', 'marked_p', false); return false;"><?php echo $text_unmark_all; ?></a>
            </dd>
            <?php } ?>
        </dl>
        <div class="forum-pagination"><?php echo $pagination; ?></div>
        </form>
        <?php } ?>
    </dd>
</dl>
<script type="text/javascript"><!--
$('#fid').bind('change', function() {
url = 'index.php?route=community/mcp&mode=mq&action=pa';

var keyword = $('.cp-header select[name=\'fid\']').attr('value');

if(keyword != ''){
    url += '&fid=' + encodeURIComponent(keyword);
}

location = url;
});
--></script>
<?php break; ?>
<?php case 'mq_ad': ?>
<form id="approval-detail-form" action="" method="post">
<dl>
    <dd class="cp-header">
        <a style="font-size:16px;" href="<?php echo $approval_detail['post_link']; ?>"><strong><?php echo $approval_detail['post_subject']; ?></strong></a> <br />
        <input type="hidden" name="marked_p_id[]" value="<?php echo $approval_detail['post_topic_forum_first_id'] ; ?>" />
        <span class="gray-font"><?php echo $approval_detail['posted_by']; ?></span>
    </dd>
    <dd class="cp-content">
        <div class="awaiting-approval-post-bar">
            <?php echo $text_notify_poster; ?>&nbsp;<input type="checkbox" name="notify-poster" checked="checked" />&nbsp;&nbsp;
            <input class="input-buttons" type="submit" name="approve-post" value="<?php echo $button_approve; ?>" onclick="{if(confirm('<?php echo $text_confirm_approve_post; ?>')){this.document.approval-detail-form.submit();return true;}return false;}" />
            &nbsp;&nbsp;
            <input class="input-buttons" type="submit" name="disapprove-post" value="<?php echo $button_disapprove; ?>" onclick="{if(confirm('<?php echo $text_confirm_disapprove_post; ?>')){this.document.approval-detail-form.submit();return true;}return false;}" />
        </div>
        <?php echo $approval_detail['post_text']; ?>
    </dd>
</dl>
</form>
<?php break; ?>
<?php } ?>